import { createRouter,createWebHistory } from "vue-router";
import MainBody from '../components/MainBody/index.vue'
import SaleInfo from '../View/saleInfo/index.vue'
import WorkPlace from '../View/workPlace/index.vue'
import StateManage from '../View/stateManage/index.vue'
import StaffInfo from '../View/staffInfo/index.vue'
import OrderInfo from '../View/orderInfo/index.vue'
import OperationRecord from '../View/operationRecord/index.vue'
import NormalState from '../View/stateManage/NormalState/index.vue'
import Emergency from '../View/stateManage/emergency/index.vue'
import StockOut from '../View/stateManage/stockOut/index.vue'
import Regin from '../components/Regin/index.vue'
import AddStaff from '../View/workPlace/AddStaff/index.vue'
import TaskHandle from '../View/workPlace/TaskHandle/index.vue'
import AddState from '../View/workPlace/StateHandle/AddState/index.vue'
import SearchState from '../View/workPlace/StateHandle/Search/index.vue'

const routes = [
    {
        path:'/regin',
        component:Regin
    },
    {
        path:'/',
        component:MainBody,
        children:[
            {
                path:'/',
                component:SaleInfo
            },
            {
                path:'workPlace',
                component:WorkPlace,
                children:[
                    {
                        path:'',
                        component:TaskHandle
                    },
                    {
                        path:'addStaff',
                        component:AddStaff
                    },
                    {
                        path:'addState',
                        component:AddState
                    },
                    {
                        path:'searchState',
                        component:SearchState
                    }
                ]
            },
            {
                path:'stateInfo',
                component:StateManage,
                children:[
                    {
                        path:'',
                        component:NormalState
                    },
                    {
                        path:'emergency',
                        component:Emergency
                    },
                    {
                        path:'stockOut',
                        component:StockOut
                    }
                ]
            },
            {
                path:'staffInfo',
                component:StaffInfo
            },
            {
                path:'orderInfo',
                component:OrderInfo
            },
            {
                path:'operationRecord',
                component:OperationRecord
            }
        ]
    }
]

const router = createRouter({
    history:createWebHistory(),
    routes
})
export default router